package com.ad.pet.app.mall.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ad.pet.R;
import com.ad.pet.common.data.utils.glide.GlideUtil;
import com.ad.pet.models.remote.mall.Record;

import java.util.List;

/**
 * Created by SEELE on 2019/5/14.
 */

public class GoodRecordAdapter extends BaseQuickAdapter<Record,BaseViewHolder> {
    public GoodRecordAdapter( @Nullable List<Record> data) {
        super(R.layout.item_good_record_layout, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Record item) {
      ImageView ivhead =  helper.getView(R.id.iv_head);
       TextView tvDate =  helper.getView(R.id.tv_date);
       TextView tvname =  helper.getView(R.id.tv_name);
       TextView tvCountryName = helper.getView(R.id.tv_country_name);
       TextView tvDesc =  helper.getView(R.id.tv_desc);
       tvDesc.setVisibility(View.GONE);
        GlideUtil.loadNoDefault(mContext,item.getCountry_image(),ivhead);
        tvDate.setText(item.getAdd_time());
        tvname.setText(item.getUser_name());
        tvCountryName.setText(item.getCountry());
helper.getView(R.id.view_line).setVisibility(View.GONE);
    }
}
